package com.mysoft.gfyx.clue.controller;

import com.mysoft.framework.mvc.api.Controller;
import com.mysoft.framework.rpc.annotation.PubAction;
import com.mysoft.framework.rpc.annotation.PubService;
import com.mysoft.framework.rpc.contants.RequestPrefix;
import com.mysoft.gfyx.clue.controller.dto.QuotaResponseDto;
import com.mysoft.gfyx.clue.service.ClueService;
import com.mysoft.gfyx.clue.service.CustomerService;
import com.mysoft.gfyx.clue.service.SubscriptionService;
import org.springframework.beans.factory.annotation.Autowired;

@PubService(value = "/statisticsPub", prefix = RequestPrefix.PUB)
public class StatisticsPubController extends Controller {
    @Autowired
    private ClueService clueService;

    @Autowired
    private SubscriptionService subscriptionService;

    @Autowired
    private CustomerService customerService;


    //指标数据
    @PubAction(value = "/quota")
    public QuotaResponseDto quota() {
        QuotaResponseDto quotaResponseDto = new QuotaResponseDto();
        quotaResponseDto.setMyClue(clueService.getMyClueCount());
        quotaResponseDto.setMyCustomer(customerService.getMyCustomerCount());
        quotaResponseDto.setMySubscribeItems(subscriptionService.getMySubscriptionCount());
        quotaResponseDto.setMySubscribeNews(subscriptionService.getMySubscriptionNewsCount());
        return quotaResponseDto;
    }

}
